package com.g8.pethospitallearnbackend.entity;

import org.apache.catalina.mapper.Mapper;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;

public class Paper implements Serializable {
    private String paperId;

    private String paperName;

    private Integer paperScore;

    private List<PaperQues> paperQuesList;

    public void setPaperQuesList(List<PaperQues> paperQuesList) {
        this.paperQuesList = paperQuesList;
    }

    public List<PaperQues> getPaperQuesList() {
        return paperQuesList;
    }
    //    HashMap<Question,Integer> PaperQues;
//
//    public HashMap<Question, Integer> getPaperQues() {
//        return PaperQues;
//    }
//
//    public void setPaperQues(HashMap<Question, Integer> paperQues) {
//        PaperQues = paperQues;
//    }

    public static class PaperQues{
        Question question;
        Integer score;

        public PaperQues(Question question, Integer score){
            this.question = question;
            this.score = score;
        }

        public PaperQues(){}

        public void setScore(Integer score) {
            this.score = score;
        }

        public Integer getScore() {
            return score;
        }

        public void setQuestion(Question question) {
            this.question = question;
        }

        public Question getQuestion() {
            return question;
        }
    }

    private static final long serialVersionUID = 1L;

    public String getPaperId() {
        return paperId;
    }

    public void setPaperId(String paperId) {
        this.paperId = paperId;
    }

    public String getPaperName() {
        return paperName;
    }

    public void setPaperName(String paperName) {
        this.paperName = paperName;
    }

    public Integer getPaperScore() {
        return paperScore;
    }

    public void setPaperScore(Integer paperScore) {
        this.paperScore = paperScore;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", paperId=").append(paperId);
        sb.append(", paperName=").append(paperName);
        sb.append(", paperScore=").append(paperScore);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Paper other = (Paper) that;
        return (this.getPaperId() == null ? other.getPaperId() == null : this.getPaperId().equals(other.getPaperId()))
            && (this.getPaperName() == null ? other.getPaperName() == null : this.getPaperName().equals(other.getPaperName()))
            && (this.getPaperScore() == null ? other.getPaperScore() == null : this.getPaperScore().equals(other.getPaperScore()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPaperId() == null) ? 0 : getPaperId().hashCode());
        result = prime * result + ((getPaperName() == null) ? 0 : getPaperName().hashCode());
        result = prime * result + ((getPaperScore() == null) ? 0 : getPaperScore().hashCode());
        return result;
    }
}